<?php

namespace App\Http\Middleware;

use Closure;
use App\Exceptions\GeneralException;

class BlackHouse
{
    /**
     * 用户小黑屋
     * @param $request
     * @param Closure $next
     * @return mixed
     * @throws GeneralException
     */
    public function handle($request, Closure $next)
    {
        $black = [
            '18021854988'
        ];
        $phoneNum = $request->get('phone_num');
        if (in_array($phoneNum,$black)){
            throw new GeneralException('本用户无效');

        }
        return $next($request);
    }
}